package com.kitty.game.task.model.product.targetparam;

import com.kitty.game.task.model.product.TaskTargetParam;
import com.kitty.game.task.model.product.entry.TaskStudySkillEntry;
import org.nutz.lang.util.NutMap;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**学习技能目标参数*/
public class StudySkillTargetParam extends TaskTargetParam {
    /**学习技能，分高物伤方案、高法伤方案，自定义方案*/
    private Map<Byte, TaskStudySkillEntry> skillMap;


    @Override
    public TaskTargetParam parseParam(NutMap nutMap) {
        List<TaskStudySkillEntry> skills = nutMap.getAsList("skills", TaskStudySkillEntry.class);
        skillMap = new HashMap<>(skills.size());
        for (TaskStudySkillEntry taskStudySkillEntry : skills) {
            skillMap.put(taskStudySkillEntry.getType(), taskStudySkillEntry);
        }

        return this;
    }

    public Map<Byte, TaskStudySkillEntry> getSkillMap() {
        return skillMap;
    }
}
